<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>固定定位</title>
</head>
<style>
    .w{
        width: 888px;
        height: 1400px;
        background-color: yellow;
        margin:0 auto;
    }
    .fixed{
        position: fixed;
        width: 50px;
        height: 150px;
        left:50%;
        margin-left: 450px;
        background-color: skyblue;
    }
</style>
<body>
    <div class="fixed"></div>
    <div class="w">ban</div>
</body>
</html>